package user_account_flow_reports

// 表名也是cache的tag
var TableName = "user_account_flow_reports"

// 账户变动记录日志表
type UserAccountFlowReports struct {
	Id       int64
	Tid      int64  `xorm:"integer notnull 'Tid'"`
	Pid      int64  `xorm:"integer notnull 'pid'"`
	UserId   int64  `xorm:"integer notnull 'user_id'"`
	Username string `xorm:"varchar(32) notnull 'user_name'"`

	FlowType string `xorm:"varchar(32) notnull 'flow_type'"`
	TypeId   int    `xorm:"integer notnull 'type_id'"`
	TypeName string `xorm:"varchar(64) notnull 'type_name'"`

	FromUserId  int64 `xorm:"integer null 'from_user_id'"`
	FromAdminId int64 `xorm:"integer null 'from_admin_id'"`
	ToUserId    int64 `xorm:"integer null 'to_user_id'"`

	OrderId int64 `xorm:"tinyint null default(1) 'order_id'"`
	EventId int64 `xorm:"varchar(64) null 'event_id'"`

	Amount              int64 `xorm:"bigint null default(0) 'amount'"`
	BeforeBalance       int64 `xorm:"bigint null default(0) 'before_balance'"`
	Balance             int64 `xorm:"bigint null default(0) 'balance'"`
	BeforeLockedBalance int64 `xorm:"bigint null default(0) 'before_locked_balance'"`
	LockedBalance       int64 `xorm:"bigint null default(0) 'locked_balance'"`

	// 0 未冻结
	FrozenType int `xorm:"tinyint null default(0) 'frozen_type'"`

	ProcessTime int64 `xorm:"integer null default(0) 'process_time'"`

	Status int `xorm:"tinyint null default(0) 'status'"`
}
